<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <div v-if="bol">{{obj}}</div>
      <button @click="add">添加</button>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          bol: true,
          obj: { id: 123 },
        },
        mounted() {},
        methods: {
          add() {
            // this.obj.detail = 456;
            window.console.log(this.obj);
            // this.$set(对象名,属性名,属性值)
            this.$set(this.obj, "detail", 456);
            // this.bol = false;
            // this.$nextTick(() => {
            //   this.bol = true;
            // });
          },
        },
      });
    </script>
  </body>
</html>
